/*  This file is part of the comicconquer project
    Copyright (C) 2010 Reach <reach334@gmail.com>

    ComicConquer is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This software is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public 
    License along with this software.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef QIPLIMAGE_H
#define QIPLIMAGE_H

#include <QtGui/QImage>
#include "highgui.h"
#include "cv.h"

/**
 * An image library. Provide some conversions such as converting image between QImage of Qt and IiplImage of OpenCV.
 * 
 * @author reach (5/27/2010)
 */
class QIplImage
{
public:
    static IplImage* QImageToIplImage(const QImage& image, int iscolor = CV_LOAD_IMAGE_COLOR);
    static QImage* IplImageToQImage(const IplImage *pIplImage, double min = -1, double max = -1);
    static QImage* convertToGray(QImage* imgSrc, uchar transColor = 255, bool isRetain = false);
};

#endif //QIPLIMAGE_H
